<?php
namespace bee;

/**
 *
 * @author dzelenika
 *
 */
class processor //implements Isingleton
{
  //use Tsingleton;
/*
  private function __construct()
  {  }
*/

  public static function serveRequest()
  {

    $cfg = config::getInstance();
    $app = app::__getInstance();

    if(request::getValue("__ajax", "*") != "*")
    {
      processAjax();
    } else if( $app->getFormType() == app::PAGE_TYPE_PAGE)
    {
      header('Content-type: text/html; charset=utf-8');
      processPage();
    } elseif(app::getInstance()->getFormType() == app::PAGE_TYPE_SPECIAL)
    {
      processSpecialPage();
    } elseif(app::getInstance()->getFormType() == app::PAGE_TYPE_SPECIAL_APP)
    {
      processSpecialAppPage();
    } elseif(app::getInstance()->getFormType() == app::PAGE_TYPE_FORM)
    {
      header('Content-type: text/html; charset=utf-8');
      static::processForm();
    } else
    { ; }


  }
  use TprocessForm;
}